<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    303. Range Sum Query - Immutable
   </h1>
   <p>
    Given an integer array
    <i>
     nums
    </i>
    , find the sum of the elements between indices
    <i>
     i
    </i>
    and
    <i>
     j
    </i>
    (
    <i>
     i
    </i>
    &le;
    <i>
     j
    </i>
    ), inclusive.
   </p>
   <p>
    <b>
     Example:
    </b>
    <br>
   </p>
   <pre>
Given nums = [-2, 0, 3, -5, 2, -1]

sumRange(0, 2) -&gt; 1
sumRange(2, 5) -&gt; -1
sumRange(0, 5) -&gt; -3
</pre>
   <p>
    <b>
     Note:
    </b>
    <br>
   </p>
   <ol>
    <li>
     You may assume that the array does not change.
    </li>
    <li>
     There are many calls to
     <i>
      sumRange
     </i>
     function.
    </li>
   </ol>
  </div>
  <div>
   <h1 class="question_title">
    303. 区域和检索 - 数组不可变
   </h1>
   <p>
    给定一个整数数组 &nbsp;
    <em>
     nums
    </em>
    ，求出数组从索引&nbsp;
    <em>
     i&nbsp;
    </em>
    到&nbsp;
    <em>
     j&nbsp;&nbsp;
    </em>
    (
    <em>
     i
    </em>
    &nbsp;&le;&nbsp;
    <em>
     j
    </em>
    ) 范围内元素的总和，包含&nbsp;
    <em>
     i,&nbsp; j&nbsp;
    </em>
    两点。
   </p>
   <p>
    <strong>
     示例：
    </strong>
   </p>
   <pre>给定 nums = [-2, 0, 3, -5, 2, -1]，求和函数为 sumRange()

sumRange(0, 2) -&gt; 1
sumRange(2, 5) -&gt; -1
sumRange(0, 5) -&gt; -3</pre>
   <p>
    <strong>
     说明:
    </strong>
   </p>
   <ol>
    <li>
     你可以假设数组不可变。
    </li>
    <li>
     会多次调用&nbsp;
     <em>
      sumRange
     </em>
     &nbsp;方法。
    </li>
   </ol>
  </div>
 </body>
</html>